home *** CD-ROM | disk | FTP | other *** search
/ SGI MIPSpro C Compiler 7.2 / SGI MIPSpro C Compiler 7.2.iso / relnotes / c_fe / ch6.z / ch6
Text File  |  1997-09-05  |  10KB  |  462 lines

  1.  
  2.  
  3.  
  4.                                                - 1 -
  5.  
  6.  
  7.  
  8.                     7.2 ANSI C Front-End Release Notes
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.                                                - 2 -
  69.  
  70.  
  71.  
  72.                     DDDDooooccccuuuummmmeeeennnntttt NNNNuuuummmmbbbbeeeerrrr 000000007777----1111666655559999----000011110000
  73.  
  74.  
  75.                     6.  _B_u_g__F_i_x_e_s
  76.  
  77.                     This chapter briefly describes the bugs that
  78.                     have been fixed in the compiler since release
  79.                     7.1.  Some of the headings are followed by a
  80.                     Silicon Graphics incident report number.
  81.  
  82.                        +o The following line of code was incorrectly
  83.                          being compiled under -n32 with MIPSpro 7.1
  84.  
  85.                          return ( ! !((!(error) || (*(error) == (1)))) )
  86.  
  87.                          This has been fixed (Bug 449456)
  88.  
  89.                        +o Under certain circumstances the C compiler
  90.                          would dump core with the following message:
  91.  
  92.                          Signal: Segmentation fault in Scope Setup phase.
  93.                          Error: Signal Segmentation fault in phase Scope Setup -- processing
  94.                          aborted
  95.                          cc ERROR:  /usr/lib32/cmplrs/fec died due to signal 4
  96.                          cc ERROR:  core dumped
  97.  
  98.                          This has been fixed (Bug 470114)
  99.  
  100.                        +o Incorrect code produced under optimization
  101.                          (-O2 or higher).
  102.                          The compiler incorrectly optimized the
  103.                          following code:  (A workaround was provided
  104.                          under the #ifdef OPT_BUG)
  105.  
  106.  
  107.                              for (args = result; num_args1 != 0; num_args1--)
  108.                                  *args++ = *args1++;
  109.                          #ifdef OPT_BUG /* Workaround of compiler 7.1 bug */
  110.                              while (num_args2-- > 0)
  111.                          #else
  112.                              for (             ; num_args2 != 0; num_args2--)
  113.                          #endif
  114.                                  *args++ = *args2++;
  115.  
  116.                              return result
  117.  
  118.  
  119.                          This bug has been fixed. (Bug #428276)
  120.  
  121.                        +o Incorrect optimization under -O3.
  122.                          The following code would produce incorrect
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                                                - 3 -
  135.  
  136.  
  137.  
  138.                          results when compiled under -O3:
  139.  
  140.  
  141.                          /* test1.c */
  142.                          #include <stdio.h>
  143.  
  144.                          main()
  145.  
  146.                          {
  147.                             char str[] = "1.2345";
  148.                             char *cp = str;
  149.                             char *cpe = NULL;
  150.  
  151.                             printf ("1. scp = %s, cp = %x0, cp, (unsigned int) cp);
  152.                             while (cp != cpe)
  153.                             {
  154.                                if (*cp++ == '.') break;
  155.                             }
  156.                             printf ("2. scp = %s, cp = %x0, cp, (unsigned int) cp);
  157.                          }
  158.  
  159.  
  160.  
  161.                          This has been fixed. (Bug #447872)
  162.  
  163.  
  164.                        +o Incorrect optimization under -O3.
  165.                          The following code would produce incorrect
  166.                          results when compiled under -O3:
  167.  
  168.  
  169.                          /* test1.c */
  170.                          #include <stdio.h>
  171.  
  172.                          main()
  173.  
  174.                          {
  175.                             char str[] = "1.2345";
  176.                             char *cp = str;
  177.                             char *cpe = NULL;
  178.  
  179.                             printf ("1. scp = %s, cp = %x0, cp, (unsigned int) cp);
  180.                             while (cp != cpe)
  181.                             {
  182.                                if (*cp++ == '.') break;
  183.                             }
  184.                             printf ("2. scp = %s, cp = %x0, cp, (unsigned int) cp);
  185.                          }
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.                                                - 4 -
  201.  
  202.  
  203.  
  204.                          This has been fixed. (Bug #447872)
  205.  
  206.  
  207.                        +o Improper handling of __return_address
  208.                          The following code gets incorrectly
  209.                          compiled -n32 because the reference to
  210.                          __return_address causes the return address
  211.                          from buggy to be retrieved with incorrect
  212.                          sign extension.
  213.  
  214.                              void buggy() { bar(__return_address); }
  215.  
  216.                          This has been fixed. (Bug #460589)
  217.  
  218.                        +o INTERNAL ERROR when compiling C code with
  219.                          #pragma numthreads.
  220.                          The following example illustrates an
  221.                          INTERNAL ERROR in /usr/lib32/cmplrs/be:
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.                                                - 5 -
  267.  
  268.  
  269.  
  270.                          %cc -mp -O3 -xansi -64 -mips4 -TENV:X=1 -OPT:alias=restrict -c file.c
  271.  
  272.  
  273.                          ### Compiler Error in file irvcc2.c during MP Lowering phase:
  274.                          ### out of context pragma (NUMTHREADS) in MP processing
  275.                          cc INTERNAL ERROR:  /usr/lib32/cmplrs/be returned non-zero status 1
  276.  
  277.                          %cat file.c
  278.                          void
  279.                          fored (int *rmatbeg, int *rmatind, double *rmatval, int *rmatend,
  280.                          int rows, int cols, double *y, double *x, int maxthreads)
  281.                          {
  282.  
  283.                          int     i, j, j1, k, l;
  284.                          double  temp;
  285.  
  286.                             if ( mpc_in_parallel_region() )  maxthreads = 1;
  287.                          #pragma  parallel
  288.                          #pragma  numthreads (min=1;max=maxthreads)
  289.                          #pragma  shared (rmatbeg, rmatend, rmatind, rmatval, y, x, rows)
  290.                          #pragma  local (i, k, l, temp)
  291.                             {
  292.                          #pragma  pfor iterate(i=0;rows;1) schedtype(gss)
  293.                                for (i = 0; i < rows; i++) {
  294.                                   temp = 0.0;
  295.                                   l = rmatend[i];
  296.                          #pragma ivdep
  297.                                   for (k = rmatbeg[i]; k < l; k++) {
  298.                                      temp += rmatval[k]*x[rmatind[k]];
  299.                                   }
  300.                                   y[i] = temp;
  301.                                }  /* End for loop */
  302.                             }  /* End parallel section */
  303.  
  304.                          }
  305.  
  306.                          This has been fixed. (Bug #461670)
  307.  
  308.                        +o Incorrect promotion of formal arguments.
  309.                          The following code would produce incorrect
  310.                          results when compiled -64.
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.                                                - 6 -
  333.  
  334.  
  335.  
  336.  
  337.                          #include <stdio.h>
  338.  
  339.                          int R_DIEDRE(xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd)
  340.  
  341.                          float xa,ya,za;/* coord. du 1er atome */
  342.                          float xb,yb,zb;/* coord. du 2eme atome */
  343.                          float xc,yc,zc;/* coord. du 3eme atome */
  344.                          float xd,yd,zd;/* coord. du 4eme atome */
  345.                          {
  346.                           printf("%f %f %f %f %f %f %f %f %f %f %f
  347.                          %f0,xa,ya,za,xb,yb,zb,xc,yc,zc,xd,yd,zd);
  348.  
  349.                           return(0);
  350.                          }
  351.  
  352.  
  353.                          main()
  354.                          {
  355.                           float X[40],Y[40],Z[40],ang;
  356.  
  357.                           R_DIEDRE(123.4,123.4,123.4,
  358.                                    123.4,123.4,123.4,
  359.                                    123.4,123.4,123.4,
  360.                                    123.4,123.4,123.4);
  361.  
  362.                          }
  363.  
  364.  
  365.                          This has been fixed (Bug #465609).
  366.  
  367.                        +o Incorrect sign extension induced by
  368.                          optimizer
  369.                          Under certain circumstances the optimizer
  370.                          would produce code with values incorrectly
  371.                          sign extended.  This has been fixed (Bugs
  372.                          #467930 and #468670).
  373.  
  374.                        +o Assertion failure in compiler back-end.
  375.                          The following code would cause the
  376.                          compilation to fail for -n32 compiles:
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.                                                - 7 -
  399.  
  400.  
  401.  
  402.                          typedef struct bar {
  403.                              unsigned long  size;
  404.                              unsigned long  space;
  405.                          } bar;
  406.  
  407.                          typedef struct foo {
  408.                              bar      dict;
  409.                          } foo;
  410.  
  411.                          #define size(d)  ((d)->size-(d)->space)
  412.  
  413.                          void spam (foo *baz)
  414.                          {
  415.                              int flag = 1;
  416.  
  417.                              flag &= (size(&baz->dict) <= 4294967295U);
  418.                          }
  419.  
  420.                          This has been fixed (Bug #469411).
  421.  
  422.                        +o cc generates bad code when assigning to a
  423.                          variable in expression
  424.                          Under certain circumstances cc would
  425.                          generate bad code when assigning to a
  426.                          variable in an expression.  This has been
  427.                          fixed (Bug 462177).
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.  
  461.